import http from "../utils/http/service";

// 项目空间-区域工厂接口
export const getDeptTreeByPro = (data): any => {
  return http.post(`/snow-admin/thdDept/getDeptTreeByPro`, data);
};

// 区域工厂接口
export const getDeptTree = (data): any => {
  return http.post(`/snow-admin/thdDept/getDeptTree`, data);
};

// 区域接口（不包含工厂）
export const getSecDeptTree = (data): any => {
  return http.post(`/snow-admin/thdDept/getSecDeptTree`, data);
};

// 项目模板相关接口

// 项目模板列表
export const projectTemplateList = (data): any => {
  return http.post(`/snow-admin/projectTemplate/projectTemplateList`, data);
};
// 删除模板
export const delTemplateList = (data): any => {
  return http.post(`/snow-admin/projectTemplate/delete`, data);
};
// 新增模板
export const addTemplateList = (data): any => {
  return http.post(`/snow-admin/projectTemplate/add`, data);
};
// 编辑模板
export const updateTemplateList = (data): any => {
  return http.post(`/snow-admin/projectTemplate/update`, data);
};
// 模板详情
export const getTemplateInfo = (data): any => {
  return http.get(`/snow-admin/projectTemplate/info/${data.id}`);
};

// A类、B类项目相关接口
// 创建项目
export const addProject = (data): any => {
  return http.post(`/snow-admin/thdProjectManage/add`, data);
};

// 查询项目
export const projectManageList = (data): any => {
  return http.post(`/snow-admin/thdProjectManage/thdProjectManageList`, data);
};

// 项目详情
export const getProjectInfo = (data): any => {
  return http.get(`/snow-admin/thdProjectManage/info/${data.id}`);
};

// 创建标段
export const addSection = (data): any => {
  return http.post(`/snow-admin/projectSection/add`, data);
};

// 删除标段
export const deleSection = (data): any => {
  return http.post(`/snow-admin/projectSection/delete`, data);
};

// 编辑标段
export const updateSection = (data): any => {
  return http.post(`/snow-admin/projectSection/update`, data);
};

// 查询标段列表
export const getSection = (data): any => {
  return http.post(`/snow-admin/projectSection/sectionList`, data);
};

// 获取标段详情
export const getSectionInfo = (data): any => {
  return http.get(`/snow-admin/projectSection/info/${data.id}`);
};

// 创建单体
export const addMonomer = (data): any => {
  return http.post(`/snow-admin/proSecMonomer/add`, data);
};

// 删除单体
export const deleMonomer = (data): any => {
  return http.post(`/snow-admin/proSecMonomer/delete`, data);
};

// 编辑单体
export const updateMonomer = (data): any => {
  return http.post(`/snow-admin/proSecMonomer/update`, data);
};

// 查询单体列表
export const getMonomer = (data): any => {
  return http.post(`/snow-admin/proSecMonomer/monList`, data);
};

// 获取单体详情
export const getMonomerInfo = (data): any => {
  return http.get(`/snow-admin/proSecMonomer/info/${data.id}`);
};

// 查询项目A类标段的工程类型基础数据字典列表-树状结构
export const getBaseTree = (data): any => {
  return http.post(`/snow-admin/engineerBase/getBaseTree`, data);
};

// 查询项目A类标段的工程类型基础数据字典列表-列表
export const getBaseList = (data): any => {
  return http.post(`/snow-admin/engineerBase/baseList`, data);
};

// B类项目
// 项目组管理-列表
export const projectTeamList = (data): any => {
  return http.post(`/snow-admin/thdProUser/proUserList`, data);
};

// 项目组管理-添加成员-支持批量
export const addToProjectTeamList = (data): any => {
  return http.post(`/snow-admin/thdProUser/addBatch`, data);
};

// 项目组管理-编辑成员
export const updateProjectTeam = (data): any => {
  return http.post(`/snow-admin/thdProUser/update`, data);
};

// 项目组管理-删除成员
export const delProjectTeam = (data): any => {
  return http.post(`/snow-admin/thdProUser/delete`, data);
};

// 项目列表阶段任务清单
export const proTmpStageList = (data): any => {
  return http.post(`/snow-admin/proTmpStage/proTmpStageList`, data);
};

// 项目事项-列表数据
export const templateTaskList = (data): any => {
  return http.post(`/snow-admin/templateTask/templateTaskList`, data);
};

// 项目事项-启动-->暂存
export const storageFlowdata = (data): any => {
  return http.post(`/snow-admin/thdFlowForm/storageFlowdata`, data);
};

// 项目事项-启动
export const flowStart = (data): any => {
  return http.post(`/snow-admin/thdFlowForm/flowStart`, data);
};

// 项目事项 - 删除
export const taskDelete = (data): any => {
  return http.post(`/snow-admin/templateTask/delete`, data);
};

// 项目事项-审批、提交
export const flowSubmit = (data): any => {
  return http.post(`/snow-admin/thdFlowForm/flowSubmit`, data);
};

// 项目事项-转办
export const transfer = (data): any => {
  return http.post(`/snow-admin/flow/common/changeAssignee`, data);
};

// 项目事项-驳回
export const postFlowReject = (data): any => {
  return http.post(`/snow-admin/thdFlowForm/flowReject`, data);
};

// 审批列表详情
export const getFlowInfo = (data): any => {
  return http.get(`/snow-admin/thdFlowForm/flowInfo/${data.id}`);
};

// 项目权限

//获取项目权限列表
export const thdRoleList = (data): any => {
  return http.post(`/snow-admin/thdRole/thdRoleList`, data);
};

// 新增项目权限
export const addthdRole = (data): any => {
  return http.post(`/snow-admin/thdRole/add`, data);
};

// 删除项目权限
export const deletethdRole = (data): any => {
  return http.post(`/snow-admin/thdRole/delete`, data);
};

// 编辑项目权限
export const updatethdRole = (data): any => {
  return http.post(`/snow-admin/thdRole/update`, data);
};

// 获取角色资源列表
export const resourceGroupList = (data): any => {
  return http.post("/snow-admin/sysResource/resourceGroupList", data);
};

//获取角色菜单列表
export const menuGroupList = (data): any => {
  return http.post("/snow-admin/sysMenu/menuABList", data);
};

// 获取角色拥有的资源权限
export const getRoleResourceAuth = (data): any => {
  return http.post("/snow-admin/thdRole/getRoleResourceAuth", data);
};

// 获取角色拥有的菜单权限
export const getRoleMenuAuth = (data): any => {
  return http.post("/snow-admin/thdRole/getRoleMenus", data);
};

// 保存角色资源权限
export const saveRoleResourceAuth = (data): any => {
  return http.post("/snow-admin/thdRole/roleResourceAuth", data);
};

// 保存角色菜单权限
export const saveRoleMenuAuth = (data): any => {
  return http.post("/snow-admin/thdRole/roleMenu", data);
};

//获取用户拥有的该项目菜单
export const getProjectMenu = (data): any => {
  return http.post("/snow-admin/thdRole/getMenuTree", data);
};

//获取用户拥有的该项目按钮
export const getProjectResourceAuth = (data): any => {
  return http.post("/snow-admin/thdRole/resourceAuth", data);
};
